INCLUDE=-I$(@D)
CFLAGS=-s -O2 -Wall
all: AAtree rbtree avl
AAtree: main.o AA_tree.o random.o select.o
	gcc $(CFLAGS) -o a $(INCLUDE) main.o AA_tree.o random.o select.o 
AA_tree.o: AA_tree.c  rbtree.h
	gcc $(CFLAGS) -c $(INCLUDE) AA_tree.c
random.o: random.c random.h
	gcc $(CFLAGS) -c $(INCLUDE) random.c
select.o: select.c random.h select.h
	gcc $(CFLAGS) -c $(INCLUDE) select.c
main.o: main.c rbtree.h random.h select.h
	gcc $(CFLAGS) -c $(INCLUDE) main.c
	
	
rbtree: main.o rbtree.o random.o select.o
	gcc $(CFLAGS) -o r $(INCLUDE) main.o rbtree.o random.o select.o 
rbtree.o: rbtree.c  rbtree.h
	gcc $(CFLAGS) -c $(INCLUDE) rbtree.c
	
	
avl: main.o avl.o random.o select.o
	gcc $(CFLAGS) -o avl $(INCLUDE) main.o avl.o random.o select.o 
avl.o: avl.c rbtree.h
	gcc $(CFLAGS) -c $(INCLUDE) avl.c
clean: 
	rm a r avl *.o

